package com.tbit.uqbike.enums;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * 标记状态
 *
 *
 * @author <a href="mailto:chen.chaoxiong@tbit.com.cn">ChenChaoXiong</a>
 * @since 2024/7/10
 */
public enum TagBindStatus {
    //标记状态，取消标记: canceled 0,标记中: binding 1
    CANCELED(0, "canceled", "取消标记"),
    BINDING(1, "binding", "标记中");

    @EnumValue
    private Integer value;


    private String code;

    private String desc;

    TagBindStatus(Integer value, String code, String desc) {
        this.value = value;
        this.code = code;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    @JSONField(serialize = true)
    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static TagBindStatus getTagBindStatsByCode(String code) {
        for (TagBindStatus tagBindStats : TagBindStatus.values()) {
            if (tagBindStats.code.equals(code)) {
                return tagBindStats;
            }
        }
        return null;
    }
}
